package hy;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
public class UserCtl {
    @RequestMapping("/login")
    public String hello(HttpSession session, String username) {

        System.out.println("this is 8080,session is:" + session.getClass().getName());
        session.setAttribute("username", username);
        //注意：这里的session已不是传统session,被重构成新的session，存储在redis中
        System.out.println("name:" + username + ",sessionID：" + session.getId());
        return "success";
    }
}